package com.jcl.recruit.resume.provider;

import com.jcl.recruit.resume.model.ResumeOrig;

import static org.apache.ibatis.jdbc.SqlBuilder.*;

public class ResumeOrigSqlProvider {

    public String insertSelective(ResumeOrig record) {
        BEGIN();
        INSERT_INTO("resume_orig");
        
        if (record.getOid() != null) {
            VALUES("oid", "#{oid,jdbcType=VARCHAR}");
        }
        
        if (record.getRealname() != null) {
            VALUES("realname", "#{realname,jdbcType=VARCHAR}");
        }
        
        if (record.getSource() != null) {
            VALUES("source", "#{source,jdbcType=VARCHAR}");
        }
        
        if (record.getContent() != null) {
            VALUES("content", "#{content,jdbcType=VARCHAR}");
        }
        
        if (record.getKeyword() != null) {
            VALUES("keyword", "#{keyword,jdbcType=VARCHAR}");
        }
        
        if (record.getUrl() != null) {
            VALUES("url", "#{url,jdbcType=VARCHAR}");
        }
        
        if (record.getStatus() != null) {
            VALUES("status", "#{status,jdbcType=INTEGER}");
        }
        
        if (record.getCreatetime() != null) {
            VALUES("createtime", "#{createtime,jdbcType=TIMESTAMP}");
        }
        
        return SQL();
    }

    public String updateByPrimaryKeySelective(ResumeOrig record) {
        BEGIN();
        UPDATE("resume_orig");
        
        if (record.getOid() != null) {
            SET("oid = #{oid,jdbcType=VARCHAR}");
        }
        
        if (record.getRealname() != null) {
            SET("realname = #{realname,jdbcType=VARCHAR}");
        }
        
        if (record.getSource() != null) {
            SET("source = #{source,jdbcType=VARCHAR}");
        }
        
        if (record.getContent() != null) {
            SET("content = #{content,jdbcType=VARCHAR}");
        }
        
        if (record.getKeyword() != null) {
            SET("keyword = #{keyword,jdbcType=VARCHAR}");
        }
        
        if (record.getUrl() != null) {
            SET("url = #{url,jdbcType=VARCHAR}");
        }
        
        if (record.getStatus() != null) {
            SET("status = #{status,jdbcType=INTEGER}");
        }
        
        if (record.getCreatetime() != null) {
            SET("createtime = #{createtime,jdbcType=TIMESTAMP}");
        }
        
        WHERE("id = #{id,jdbcType=INTEGER}");
        
        return SQL();
    }
}